using System;
using System.Collections.Generic;
using Hematology.Data.Interface;

namespace Hematology.Data
{
	public partial class Job : IComparable<Job>, ISimpleData
	{
		public static List<Job> GetAllJobs(int countryId, int? regionId, int? cityId)
		{
			return Search(null, countryId, regionId, cityId, null, null, true, false, null, null);
		}

		public void Save()
		{
			IsVisible = true;
			IsDeleted = false;
			CreateDate = DateTime.Now;
			LastModifiedDate = DateTime.Now;

			Insert();
		}

		public void UpdateInstance()
		{
			LastModifiedDate = DateTime.Now;

			Update();
		}

		public void MarkAsDeleted()
		{
			IsDeleted = true;

			Update();
		}

		public int CompareTo(Job other)
		{
			return FullName.CompareTo(other.FullName);
		}
	}
}

